clc; clear; close all;

%late 2 2, ft rate 58.3%
run1ar=[ 5.0000         0         0
    6.0000         0         0
    7.0000    0.0148    1.9236
    8.0000    0.0430    0.4551
    9.0000    0.0607    0.1694
   10.0000    0.2378    0.1226
   11.0000    0.0263    0.1555
   12.0000    0.0905    1.1657
   13.0000    0.1801    0.6252
   14.0000    0.0509    0.1752
   15.0000    0.1318    0.9322
   16.0000    0.1101    0.4595
   17.0000    0.1526    0.5923
   18.0000    0.0690    0.3300
   19.0000    0.0949    0.7775
   20.0000    0.0294    1.2840
   21.0000    0.0609    0.5128
   22.0000    0.0679    0.1085
   23.0000    0.0174    0.4756
   24.0000    0.0099    0.5346
   25.0000    0.1605   24.6091
   26.0000    0.0552   20.5808
   27.0000    0.0348   17.7741
   28.0000    0.1114    0.5985
   29.0000    0.0562    0.4942];
run1ar(run1ar==0)=NaN;
figure(1)
subplot(2,1,1)
plot(run1ar(:,1),run1ar(:,2)),grid;
ylabel('\theta')
title('RMSE \theta R 1 Runs')
subplot(2,1,2)
plot(run1ar(:,1),run1ar(:,3)),grid;
ylabel('R')
xlabel('Time (k)')

run1xy=[ 5.0000         0         0
    6.0000         0         0
    7.0000    3.7013    4.9407
    8.0000    5.6416   15.6087
    9.0000    9.4676   21.1059
   10.0000   47.1841   75.3209
   11.0000    4.1979    8.7773
   12.0000   16.9463   28.5504
   13.0000   40.0794   51.1358
   14.0000   10.1258   15.2979
   15.0000   27.0301   38.1935
   16.0000   23.4600   31.1671
   17.0000   40.0702   35.5911
   18.0000   17.2146   17.2813
   19.0000   23.9221   23.7226
   20.0000    7.2218    7.5680
   21.0000   18.4035   11.7063
   22.0000   21.0061   12.9267
   23.0000    5.1682    3.6661
   24.0000    3.5048    1.1966
   25.0000   51.6326   44.0864
   26.0000   16.5727   24.5857
   27.0000   14.0371    6.6621
   28.0000   41.2701   15.4563
   29.0000   22.0933    5.2342];
run1xy(run1xy==0)=NaN;
figure(2)
subplot(2,1,1)
plot(run1xy(:,1),run1xy(:,2)),grid;
ylabel('x')
title('RMSE x y 1 Runs')
subplot(2,1,2)
plot(run1xy(:,1),run1xy(:,3)),grid;
ylabel('y')
xlabel('Time (k)')

run1xyv=[ 6.0000e+00            0            0
   7.0000e+00   4.3134e+01   1.4456e+02
   8.0000e+00   1.9436e+00   2.6053e+00
   9.0000e+00   7.9874e-01   2.7520e+00
   1.0000e+01   1.2219e+01   1.7208e+01
   1.1000e+01   1.6237e+01   2.6243e+01
   1.2000e+01   6.2111e+00   1.1440e+01
   1.3000e+01   6.2429e+00   5.6989e+00
   1.4000e+01   1.3472e+01   1.6738e+01
   1.5000e+01   3.9580e+00   6.7640e+00
   1.6000e+01   7.2694e-01   2.1841e+00
   1.7000e+01   1.5634e+01   1.5659e+01
   1.8000e+01   1.3826e+01   1.2244e+01
   1.9000e+01   1.3022e+00   7.9815e-01
   2.0000e+01   3.7026e+00   2.6589e+00
   2.1000e+01   5.5522e+00   4.6934e+00
   2.2000e+01   1.1992e-01   2.9886e-01
   2.3000e+01   4.9528e+00   3.8999e+00
   2.4000e+01   2.3653e+00   1.4397e+00
   2.5000e+01   9.4988e+00   8.5401e+00
   2.6000e+01   6.6579e+00   3.3932e+00
   2.7000e+01   5.8619e+00   3.5542e+00
   2.8000e+01   5.4297e+00   4.4238e+00
   2.9000e+01   1.1455e+01   3.8944e+00];
run1xyv(run1xyv==0)=NaN;
figure(3)
subplot(2,1,1)
plot(run1xyv(:,1), run1xyv(:,2)),grid;
ylabel('v_x')
title('RMSE v_x v_y 1 Runs')
subplot(2,1,2)
plot(run1xyv(:,1), run1xyv(:,3)),grid;
ylabel('v_y')
xlabel('Time (k)')

%late 0.6 0.4
%ft rate 73.4%
run5ar=[ 5.0000    0.6821   35.2860
    6.0000    0.1308    0.7650
    7.0000    0.0849   21.2207
    8.0000    0.0731   19.3149
    9.0000    0.0561    0.6540
   10.0000    0.1384    0.4587
   11.0000    0.1584    6.4652
   12.0000    0.1881    3.0051
   13.0000    0.2672   25.6435
   14.0000    0.2280   27.7111
   15.0000    0.2066   28.3798
   16.0000    0.1446    3.8275
   17.0000    2.7736   40.2381
   18.0000    0.4214   35.4866
   19.0000    0.4382   36.4977
   20.0000    0.0755    0.4109
   21.0000    0.2035    0.7450
   22.0000    0.0383    0.5928
   23.0000    0.0348    0.8949
   24.0000    0.1128    0.6782
   25.0000    1.3868    5.5789
   26.0000    0.0703   11.3701
   27.0000    0.1702    0.5220
   28.0000    0.0932    0.6452
   29.0000    0.0756   26.1736];
run5ar(run5ar==0)=NaN;
figure(4)
subplot(2,1,1)
plot(run5ar(:,1),run5ar(:,2)),grid;
ylabel('\theta')
title('RMSE \theta R 5 Runs')
subplot(2,1,2)
plot(run5ar(:,1),run5ar(:,3)),grid;
ylabel('R')
xlabel('Time (k)')

run5xy=[5.0000e+00   1.9175e+02   1.7921e+02
   6.0000e+00   1.9179e+01   4.9238e+01
   7.0000e+00   2.4331e+01   3.1603e+01
   8.0000e+00   2.4307e+01   2.4824e+01
   9.0000e+00   8.1742e+00   1.9695e+01
   1.0000e+01   1.8474e+01   4.8905e+01
   1.1000e+01   2.9342e+01   5.1048e+01
   1.2000e+01   3.4813e+01   5.9738e+01
   1.3000e+01   4.5280e+01   9.2689e+01
   1.4000e+01   4.2515e+01   7.8297e+01
   1.5000e+01   3.5680e+01   7.3296e+01
   1.6000e+01   2.9377e+01   4.2565e+01
   1.7000e+01   8.9832e+01   1.3117e+02
   1.8000e+01   9.7098e+01   1.3064e+02
   1.9000e+01   1.0224e+02   1.3400e+02
   2.0000e+01   2.0558e+01   1.7418e+01
   2.1000e+01   5.4042e+01   4.8990e+01
   2.2000e+01   1.1589e+01   7.5975e+00
   2.3000e+01   1.0863e+01   6.7591e+00
   2.4000e+01   3.7960e+01   1.6933e+01
   2.5000e+01   5.5154e+01   1.3968e+02
   2.6000e+01   2.6072e+01   1.3242e+01
   2.7000e+01   5.8922e+01   2.9710e+01
   2.8000e+01   3.5810e+01   9.3658e+00
   2.9000e+01   3.2873e+01   2.3264e+01];
run5xy(run5xy==0)=NaN;
figure(5)
subplot(2,1,1)
plot(run5xy(:,1),run5xy(:,2)),grid;
ylabel('x')
title('RMSE x y 5 Runs')
subplot(2,1,2)
plot(run5xy(:,1),run5xy(:,3)),grid;
ylabel('y')
xlabel('Time (k)')

run5xyv=[6.0000e+00   1.7367e+02   1.3247e+02
   7.0000e+00   1.5716e+01   2.8447e+01
   8.0000e+00   4.8372e+01   1.2182e+02
   9.0000e+00   3.4620e+01   1.2508e+02
   1.0000e+01   1.5146e+01   3.5531e+01
   1.1000e+01   1.7513e+01   3.2296e+01
   1.2000e+01   2.2172e+01   3.7802e+01
   1.3000e+01   6.9021e+01   5.1908e+01
   1.4000e+01   2.3707e+01   3.3658e+01
   1.5000e+01   1.8684e+01   2.4240e+01
   1.6000e+01   6.8656e+01   4.0694e+01
   1.7000e+01   1.6599e+01   1.2381e+02
   1.8000e+01   2.1793e+01   3.6244e+01
   1.9000e+01   2.4876e+01   2.3391e+01
   2.0000e+01   2.5022e+01   1.0873e+02
   2.1000e+01   1.3674e+01   1.2646e+01
   2.2000e+01   2.3213e+01   1.9505e+01
   2.3000e+01   3.1745e+00   1.3282e+00
   2.4000e+01   1.6176e+01   7.5712e+00
   2.5000e+01   2.2429e+01   5.0652e+01
   2.6000e+01   1.3965e+01   4.5506e+01
   2.7000e+01   7.8510e+01   2.9213e+01
   2.8000e+01   1.0807e+02   3.5636e+01
   2.9000e+01   1.4504e+01   1.1820e+01];
run5xyv(run5xyv==0)=NaN;
figure(6)
subplot(2,1,1)
plot(run5xyv(:,1), run5xyv(:,2)),grid;
ylabel('v_x')
title('RMSE v_x v_y 5 Runs')
subplot(2,1,2)
plot(run5xyv(:,1), run5xyv(:,3)),grid;
ylabel('v_y')
xlabel('Time (k)')
%late 2.9 6.3
%ft rate 78.8%
run10ar=[ 5.0000    0.2490   34.3358
    6.0000    0.1445   10.3380
    7.0000    0.1151    8.6617
    8.0000    0.2260   15.0866
    9.0000    0.2005   14.9017
   10.0000    0.1862   15.7906
   11.0000    0.0538    0.7169
   12.0000    0.3690   20.1222
   13.0000    0.3525   21.3502
   14.0000    0.3860   27.9757
   15.0000    0.1295    3.4640
   16.0000    0.1806    5.0346
   17.0000    0.0810   23.7589
   18.0000    0.0866   24.2122
   19.0000    0.0893   24.4591
   20.0000    0.0743    0.7154
   21.0000    0.1467    5.8844
   22.0000    0.1135    1.4763
   23.0000    0.1446    6.6753
   24.0000    0.1075    6.2138
   25.0000    0.1593    9.5543
   26.0000    0.1205    7.2806
   27.0000    0.1468   11.6496
   28.0000    0.0641    5.5494
   29.0000    0.1248    4.8492];
run10ar(run10ar==0)=NaN;
figure(7)
subplot(2,1,1)
plot(run10ar(:,1),run10ar(:,2)),grid;
ylabel('\theta')
title('RMSE \theta R 10 Runs')
subplot(2,1,2)
plot(run10ar(:,1),run10ar(:,3)),grid;
ylabel('R')
xlabel('Time (k)')

run10xy=[5.0000e+00   7.7611e+01   6.5606e+01
   6.0000e+00   2.4505e+01   5.5880e+01
   7.0000e+00   1.8134e+01   4.3552e+01
   8.0000e+00   4.9108e+01   7.6716e+01
   9.0000e+00   4.8980e+01   6.4880e+01
   1.0000e+01   4.6016e+01   6.0230e+01
   1.1000e+01   1.0093e+01   1.7242e+01
   1.2000e+01   1.0640e+02   9.1184e+01
   1.3000e+01   1.0295e+02   8.6070e+01
   1.4000e+01   1.1289e+02   9.3987e+01
   1.5000e+01   2.7615e+01   3.7741e+01
   1.6000e+01   4.0167e+01   5.0409e+01
   1.7000e+01   2.7997e+01   2.4449e+01
   1.8000e+01   2.7822e+01   2.7441e+01
   1.9000e+01   2.6168e+01   3.0054e+01
   2.0000e+01   1.9956e+01   1.7373e+01
   2.1000e+01   3.6032e+01   3.7521e+01
   2.2000e+01   3.4779e+01   2.1748e+01
   2.3000e+01   4.7357e+01   2.2969e+01
   2.4000e+01   3.6592e+01   1.5540e+01
   2.5000e+01   5.4245e+01   3.3095e+01
   2.6000e+01   3.9243e+01   2.4546e+01
   2.7000e+01   5.0208e+01   2.9482e+01
   2.8000e+01   2.5002e+01   8.7252e+00
   2.9000e+01   4.8358e+01   1.5385e+01];
run10xy(run10xy==0)=NaN;
figure(8)
subplot(2,1,1)
plot(run10xy(:,1),run10xy(:,2)),grid;
ylabel('x')
title('RMSE x y 10 Runs')
subplot(2,1,2)
plot(run10xy(:,1),run10xy(:,3)),grid;
ylabel('y')
xlabel('Time (k)')

run10xyv=[6.0000e+00   1.1659e+02   2.1204e+02
   7.0000e+00   1.7488e+01   3.6751e+01
   8.0000e+00   3.8060e+01   4.4995e+01
   9.0000e+00   2.6481e+01   6.0670e+01
   1.0000e+01   1.3415e+01   2.8818e+01
   1.1000e+01   3.3814e+01   4.3779e+01
   1.2000e+01   1.3635e+02   4.2900e+01
   1.3000e+01   1.6541e+01   2.8900e+01
   1.4000e+01   4.7678e+01   4.2900e+01
   1.5000e+01   1.3575e+02   4.2169e+01
   1.6000e+01   9.8340e+00   1.3633e+01
   1.7000e+01   8.4589e+01   1.1752e+02
   1.8000e+01   1.6636e+01   1.5245e+01
   1.9000e+01   5.2055e+00   4.1938e+00
   2.0000e+01   7.1642e+01   6.5453e+01
   2.1000e+01   5.1121e+01   5.9695e+01
   2.2000e+01   2.4747e+01   2.1753e+01
   2.3000e+01   2.6295e+01   1.3849e+01
   2.4000e+01   1.6297e+01   9.1222e+00
   2.5000e+01   3.3472e+01   1.8179e+01
   2.6000e+01   1.9504e+01   7.1663e+00
   2.7000e+01   2.7846e+01   9.6522e+00
   2.8000e+01   6.2066e+01   3.6290e+01
   2.9000e+01   2.0565e+01   6.7276e+00];

figure(9)
run10xyv(run10xyv==0)=NaN;
subplot(2,1,1)
plot(run10xyv(:,1), run10xyv(:,2)),grid;
ylabel('v_x')
title('RMSE v_x v_y 10 Runs')
subplot(2,1,2)
plot(run10xyv(:,1), run10xyv(:,3)),grid;
ylabel('v_y')
xlabel('Time (k)')

%late 0.3 1.15
%ft rate 77%
run20ar=[5.0000    0.4850   23.9426
    6.0000    0.3680   21.7640
    7.0000    0.3432   24.7234
    8.0000    0.4092   18.1595
    9.0000    0.3538   18.2197
   10.0000    0.2897   10.6957
   11.0000    0.2484   11.8899
   12.0000    0.1718   10.7286
   13.0000    0.1796    7.8565
   14.0000    0.1281    8.3206
   15.0000    0.2767   12.9660
   16.0000    0.9917   19.2577
   17.0000    1.0273   19.7068
   18.0000    0.2806   20.7087
   19.0000    0.2275   15.9647
   20.0000    0.1998    9.8343
   21.0000    0.2089    6.0080
   22.0000    0.2556    6.9908
   23.0000    0.2996    4.8684
   24.0000    0.3112   13.3483
   25.0000    0.3100   11.8071
   26.0000    0.2679    7.1556
   27.0000    0.2131   17.7220
   28.0000    0.2605   16.9324
   29.0000    0.2013   22.6441];
run20ar(run20ar==0)=NaN;
figure(10)
subplot(2,1,1)
plot(run20ar(:,1),run20ar(:,2)),grid;
ylabel('\theta')
title('RMSE \theta R 20 Runs')
subplot(2,1,2)
plot(run20ar(:,1),run20ar(:,3)),grid;
ylabel('R')
xlabel('Time (k)')
run20xy=[ 5.0000e+00   1.2564e+02   1.4468e+02
   6.0000e+00   9.5033e+01   1.0639e+02
   7.0000e+00   9.1703e+01   1.0091e+02
   8.0000e+00   1.0066e+02   1.2346e+02
   9.0000e+00   9.4201e+01   9.6912e+01
   1.0000e+01   7.1516e+01   8.1122e+01
   1.1000e+01   6.0456e+01   7.1051e+01
   1.2000e+01   3.9513e+01   5.0491e+01
   1.3000e+01   4.7008e+01   4.3574e+01
   1.4000e+01   3.4009e+01   3.5533e+01
   1.5000e+01   7.9656e+01   4.9739e+01
   1.6000e+01   3.9663e+01   6.4333e+01
   1.7000e+01   4.8186e+01   6.2599e+01
   1.8000e+01   6.3412e+01   8.2381e+01
   1.9000e+01   4.9654e+01   6.8357e+01
   2.0000e+01   4.9337e+01   5.3914e+01
   2.1000e+01   4.6437e+01   6.0027e+01
   2.2000e+01   5.5234e+01   7.3169e+01
   2.3000e+01   6.7145e+01   8.2554e+01
   2.4000e+01   7.5475e+01   8.2037e+01
   2.5000e+01   7.2713e+01   8.8700e+01
   2.6000e+01   7.2037e+01   6.9105e+01
   2.7000e+01   5.7496e+01   5.7487e+01
   2.8000e+01   7.8595e+01   6.1982e+01
   2.9000e+01   6.8051e+01   4.8946e+01];
run20xy(run20xy==0)=NaN;
figure(11)
subplot(2,1,1)
plot(run20xy(:,1),run20xy(:,2)),grid;
ylabel('x')
title('RMSE x y 20 Runs')
subplot(2,1,2)
plot(run20xy(:,1),run20xy(:,3)),grid;
ylabel('y')
xlabel('Time (k)')

run20xyv=[ 6.0000e+00   1.3411e+02   2.9167e+02
   7.0000e+00   1.1115e+02   1.7778e+02
   8.0000e+00   1.2420e+02   1.4453e+02
   9.0000e+00   1.2759e+02   1.8138e+02
   1.0000e+01   1.5790e+02   9.3632e+01
   1.1000e+01   6.9886e+01   8.1310e+01
   1.2000e+01   1.0383e+02   1.2896e+02
   1.3000e+01   3.3286e+01   4.7871e+01
   1.4000e+01   3.5375e+01   4.2345e+01
   1.5000e+01   1.4835e+02   8.6716e+01
   1.6000e+01   1.4952e+02   1.2591e+02
   1.7000e+01   4.2298e+01   5.2026e+01
   1.8000e+01   6.2175e+01   9.6655e+01
   1.9000e+01   7.4064e+01   1.1652e+02
   2.0000e+01   4.5717e+01   4.6691e+01
   2.1000e+01   4.7144e+01   5.2234e+01
   2.2000e+01   3.6776e+01   3.7498e+01
   2.3000e+01   4.9474e+01   2.7108e+01
   2.4000e+01   9.4716e+01   4.0669e+01
   2.5000e+01   1.2662e+02   1.3310e+02
   2.6000e+01   5.6411e+01   9.4806e+01
   2.7000e+01   4.0310e+01   2.6799e+01
   2.8000e+01   6.3129e+01   6.7444e+01
   2.9000e+01   1.4749e+02   5.2971e+01];

figure(12)
run20xyv(run20xyv==0)=NaN;
subplot(2,1,1)
plot(run20xyv(:,1), run20xyv(:,2)),grid;
ylabel('v_x')
title('RMSE v_x v_y 20 Runs')
subplot(2,1,2)
plot(run20xyv(:,1), run20xyv(:,3)),grid;
ylabel('v_y')
xlabel('Time (k)')

